<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
		<!-- Google Chrome Frame也可以让IE用上Chrome的引擎: -->
		<meta name="renderer" content="webkit">
		<!--国产浏览器高速模式-->
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="author" content="穷在闹市" />
		<!-- 作者 -->
		<meta name="revised" content="穷在闹市.v3, 2019/05/01" />
		<!-- 定义页面的最新版本 -->
		<meta name="description" content="网站简介" />
		<!-- 网站简介 -->
		<meta name="keywords" content="搜索关键字，以半角英文逗号隔开" />
		<title>明联人才后台</title>

		<!-- 公共样式 开始 -->
		<link rel="stylesheet" type="text/css" href="back_cssAndjs/css/base.css">
		<link rel="stylesheet" type="text/css" href="back_cssAndjs/css/iconfont.css">
		<script type="text/javascript" src="back_cssAndjs/framework/jquery-1.11.3.min.js"></script>
		<link rel="stylesheet" type="text/css" href="back_cssAndjs/layui/css/layui.css">
		<script type="text/javascript" src="back_cssAndjs/layui/layui.js"></script>
		<!-- 滚动条插件 -->
		<link rel="stylesheet" type="text/css" href="back_cssAndjs/css/jquery.mCustomScrollbar.css">
		<script src="back_cssAndjs/framework/jquery-ui-1.10.4.min.js"></script>
		<script src="back_cssAndjs/framework/jquery.mousewheel.min.js"></script>
		<script src="back_cssAndjs/framework/jquery.mCustomScrollbar.min.js"></script>
		<script src="back_cssAndjs/framework/cframe.js"></script>
		<!-- 仅供所有子页面使用 -->
		<!-- 公共样式 结束 -->

	</head>
<div class="demoTable">
			搜索姓名：
			<div class="layui-inline">
				<input class="layui-input" id="strLike" name="strLike" autocomplete="off">
			</div>
			<button class="layui-btn" data-type="reload" type="button" >搜索</button>
		</div>
<table class="layui-hide" id="LAY_table_user" lay-filter="demo">

	</table>
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
</script>

	<script>
		layui.use('table', function() {
			var table = layui.table;

			//方法级渲染
			table.render({
				elem : '#LAY_table_user',
				url : 'rtc_list',

				cols : [ [ {
					checkbox : true,
					fixed : true
				}, {
					field : 'comId',
					title : 'ID',
					width : 80,
					sort : true,
					fixed : true
				}, {
					field : 'comName',
					title : '企业名',
					width : 180
				}, {
					field : 'comAddress',
					title : '地址',
					width : 180,
					sort : true
				}, {
					field : 'comMan',
					title : '负责人',
					width : 80
				}, {
					field : 'comTel',
					title : '联系方式'
				}, {
					field : 'comState',
					title : '企业状态',
					width : 80
				}, {
					field : 'vip',
					title : 'vip',
					sort : true,
					width : 50
				}, {
					field : 'comCity',
					title : '城市',
					sort : true,
					width : 135
				}, {
					field : 'comPinYin',
					title : '首字母',
					sort : true,
					width : 50
				},{
					title : '操作',
					toolbar: '#barDemo',
					width: 100
				} 
				
				] ],
				id : 'testReload',
				page : true,
				height : 310
			});

			
			//监听工具条
			  table.on('tool(demo)', function(obj){
			    var data = obj.data;
			   	if(obj.event === 'edit'){
			   
			        // 给相应文本框复制
			        $("#comId").val(data.comId);
			        $("#comName").val(data.comName);
			        $("#comMan").val(data.comMan);
			        $("#vip").val(data.vip);
			        
			        // 如果是单选按钮操作,我们需要render一下
			        layui.form.render();
			        
			      	layer.open({
			      	type: 1,
			      	title: '修改企业信息',
			      	content: $('#div1'),
			      	area: ['450px', '500px']
			      	
			      }); 
			      } 
			  });
			
			var $ = layui.$, active = {
				reload : function() {
					var demoReload = $('#strLike');

					//执行重载
					table.reload('testReload', {
						page : {
							curr : 1
						//重新从第 1 页开始
						},
						where : {
							"strLike" : demoReload.val()
						}
					}, 'data');
				}
			};

			$('.demoTable .layui-btn').on('click', function() {
				var type = $(this).data('type');
				active[type] ? active[type].call(this) : '';
			});
		});
	</script>

				<div id="div1" style="display: none; text-align: ;">
					<form class="layui-form" action="updrtc" lay-filter="example">
							<div class="layui-form-item">
							<label class="layui-form-label newbie-width-one">企业ID</label>
							<div class="layui-input-block">
								<input type="text" name="comId" id="comId" lay-verify="title"
									autocomplete="off" readonly placeholder="ID"
									class="layui-input newbie-width-two" width="200px">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label newbie-width-one">企业名</label>
							<div class="layui-input-block">
								<input type="text" name="comName" id="comName" lay-verify="title"
									autocomplete="off" readonly placeholder="请输入企业名"
									class="layui-input newbie-width-two">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label newbie-width-one">负责人</label>
							<div class="layui-input-block">
								<input type="text" name="comMan" id="comMan"
									lay-verify="title" autocomplete="off" readonly placeholder="负责人"
									class="layui-input newbie-width-two">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label newbie-width-one">身份</label>
							<div class="layui-input-block newbie-width-two">
								<select name="vip" id="vip" lay-filter="aihao">
									<option value=""></option>
									<option value="1">普通</option>
									<option value="2">VIP</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<div class="layui-input-block">
								<button type="submit" class="layui-btn" >立即提交</button>
							</div>
						</div>
					</form>
				</div>
	</body>
</html>